<?php
namespace plugin\banmichaoqiangbizhi\admin; 
use plugin\banmichaoqiangbizhi\model\PluginBanmiBanmichaoqiangbizhiNav; 
use plugin\banmichaoqiangbizhi\validate\ShopnavValidate;
use app\admin\common\Baseadmin;


class Shopnav extends Baseadmin
{
       
  
        
      /**
      * @notes  导航列表 
      * @variable  sort=; 
      * @date 2022-12-09 19:28:38
      * @author 半米科技低代码一键生成
      */
      public function   paginate_dhlb(){  
             $request= (new ShopnavValidate())->IsCheck();
             $field="id,name,img,sort";
             $map=[];
             $model =(new PluginBanmiBanmichaoqiangbizhiNav())->paginate($map,$field);
             $data['list']=$model;
             ajaxmsg('ok', 200,$data);  
      }
       
      /**
      * @notes  删除导航 
      * @variable  id=id; 
      * @date 2022-12-09 19:43:31
      * @author 半米科技低代码一键生成
      */
      public function   dels_scdh(){  
             $request= (new ShopnavValidate())->IsCheck('scdh');
              
             $map=[
                  ['id',	'='   ,    input('request.id')  ],
                  ];
              $model =(new PluginBanmiBanmichaoqiangbizhiNav())->dels($map);
              if($model){
               ajaxmsg('删除成功', 200);
              }
               ajaxmsg('删除失败', 0);  
      }
       
      /**
      * @notes  导航详情编辑 
      * @variable  id=id; 
      * @date 2022-12-09 20:06:41
      * @author 半米科技低代码一键生成
      */
      public function   finds_dhxqbj(){  
             $request= (new ShopnavValidate())->IsCheck('dhxqbj');
             $field="id,name,img,sort";
             $map=[
                  ['id',	'='   ,    input('request.id')  ],
                  ];
             $model =(new PluginBanmiBanmichaoqiangbizhiNav())->finds($map,$field);
             $data['find']=$model;
             ajaxmsg('ok', 200,$data);  
      }
       
  
       
      /**
      * @notes  编辑导航信息 
      * @variable  id=id;name=;img=;sort=; 
      * @date 2022-12-09 20:22:58
      * @author 半米科技低代码一键生成
      */
      public function   updates_bjdhxx(){  
             $request= (new ShopnavValidate())->IsCheck('bjdhxx');
             $field=["id","name","img","sort"];
               $map=[
                  ['id',	'='   ,    input('request.id')  ],
                  ];
             $model =(new PluginBanmiBanmichaoqiangbizhiNav())->updates($map,$request,$field);
              if($model){
               ajaxmsg('更新成功', 200);
              }
               ajaxmsg('更新失败', 0);  
      }
       
      /**
      * @notes  增加导航 
      * @variable  name=名称;img=图片;sort=排序; 
      * @date 2022-12-09 20:34:38
      * @author 半米科技低代码一键生成
      */
      public function   adds_zjdh(){  
             $request= (new ShopnavValidate())->IsCheck('zjdh');
             $field=["name","img","sort"];
              $model =(new PluginBanmiBanmichaoqiangbizhiNav())->adds($request,$field);
              if($model){
               ajaxmsg('新增成功', 200);
              }
               ajaxmsg('新增失败', 0);  
      }
      //控制器方法
    
    
    
}